#pragma once

#include "Misc/CommonMacros.h"
//#include "Misc/StdHead.h"

#include "Object/Object.h"
#include "Object/NewObject.h"

#include "Subsystem.m.h"

class RSubsystemManager;

RCLASS()
class WHENGINE_API RSubsystem :public RObject
{
    ROBJECT
public:
    RSubsystem(){}; //Only for reflect
    virtual ~RSubsystem(){};
    
    //can be invoked in Initialize() to get the manager of this subsystem
    RSubsystemManager* GetManager()
    {
        return Manager;
    }

    virtual void Initialize(){};
    virtual void Deinitialize(){};

private:
    //manager of this subsystem
    //will be set by RSubsystemManager before Initialize() is called
    RSubsystemManager* Manager=nullptr;

    friend class RSubsystemManager;
};


